﻿using System.Collections.Generic;
using Best.SmartCms.Dao;
using Best.SmartCms.Domain;
using Best.SmartCms.Domain.Security;
using Best.SmartCms.Service.Common;

namespace Best.SmartCms.Service.Security
{
    public class BusinessSystemService: IService
    {
        private readonly BusinessSystemDao _businessSystemDao;

        public BusinessSystemService(MySqlDbContext mySqlDbContext)
        {
            _businessSystemDao = new BusinessSystemDao(mySqlDbContext);
        }

        /// <summary>
        /// 获取私钥
        /// </summary>
        /// <param name="accessKey"></param>
        /// <returns></returns>
        public string GetSecretByAccessKey(string accessKey)
        {
            return _businessSystemDao.GetSecretByAccessKey(accessKey);
        }

        /// <summary>
        /// 查找所有系统
        /// </summary>
        /// <returns></returns>
        public List<BusinessSystem> GetAll()
        {
            return _businessSystemDao.GetAllBusinessSystems();
        }
    }
}
